<?php
/**
 * $Id: permissions.php,v 1.5 2005/02/06 18:29:52 phppp Exp $
 * Module: WF-Downloads
 * Version: v2.0.5a
 * Release Date: 26 july 2004
 * Author: WF-Sections
 * Licence: GNU
 */

include 'admin_header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';

xoops_cp_header();
wfl_adminmenu( _AM_WFL_PERM_MANAGEMENT );

echo "<h4>" . _AM_WFL_PERM_CPERMISSIONS . "</h4>\n";
$cat_form = new XoopsGroupPermForm( '', $xoopsModule -> getVar( 'mid' ), 'WFLinkCatPerm', _AM_WFL_PERM_CSELECTPERMISSIONS."<br />" );
$result = $xoopsDB -> query( "SELECT cid, pid, title FROM " . $xoopsDB -> prefix( WFLINKS_CAT ) );
if ( $xoopsDB -> getRowsNum( $result ) )
{
    while ( $cat_row = $xoopsDB -> fetcharray( $result ) )
    {
        $cat_form -> addItem( $cat_row['cid'], $cat_row['title'], $cat_row['pid'] );
    } 
    echo $cat_form -> render();
} 
else
{
    echo "<div><b>" . _AM_WFL_PERM_CNOCATEGORY . "</b></div>";
} 
unset ( $cat_form );
/*
* 
*/ 
echo "<h4>" . _AM_WFL_PERM_SPERMISSIONS . "</h4>\n";
$sub_form = new XoopsGroupPermForm( '', $xoopsModule -> getVar( 'mid' ), 'WFLinkSubPerm', _AM_WFL_PERM_SPERMISSIONS_TEXT."<br />" );
$result = $xoopsDB -> query( "SELECT cid, pid, title FROM " . $xoopsDB -> prefix( WFLINKS_CAT ) );
if ( $xoopsDB -> getRowsNum( $result ) )
{
    while ( $sub_row = $xoopsDB -> fetcharray( $result ) )
    {
        $sub_form -> addItem( $sub_row['cid'], $sub_row['title'], $sub_row['pid'] );
    } 
    echo $sub_form -> render();
} 
else
{
    echo "<div><b>" . _AM_WFL_PERM_CNOCATEGORY . "</b></div>";
} 
unset ( $sub_form );
/*
* 
*/ 
echo "<h4>" . _AM_WFL_PERM_APERMISSIONS . "</h4>\n";
$cat_form = new XoopsGroupPermForm( '', $xoopsModule -> getVar( 'mid' ), 'WFLinkAppPerm', _AM_WFL_PERM_APERMISSIONS_TEXT."<br />" );
$result = $xoopsDB -> query( "SELECT cid, pid, title FROM " . $xoopsDB -> prefix( WFLINKS_CAT ) );
if ( $xoopsDB -> getRowsNum( $result ) )
{
    while ( $cat_row = $xoopsDB -> fetcharray( $result ) )
    {
        $cat_form -> addItem( $cat_row['cid'], $cat_row['title'], $cat_row['pid'] );
    } 
    echo $cat_form -> render();
} 
else
{
    echo "<div><b>" . _AM_WFL_PERM_CNOCATEGORY . "</b></div>";
} 
unset ( $cat_form );

/*
* 
*/ 
echo "<h4>" . _AM_WFL_PERM_AUTOPERMISSIONS . "</h4>\n";
$cat_form = new XoopsGroupPermForm( '', $xoopsModule -> getVar( 'mid' ), 'WFLinkAutoApp', _AM_WFL_PERM_AUTOPERMISSIONS_TEXT."<br />" );
$result = $xoopsDB -> query( "SELECT cid, pid, title FROM " . $xoopsDB -> prefix( WFLINKS_CAT ) );
if ( $xoopsDB -> getRowsNum( $result ) )
{
    while ( $cat_row = $xoopsDB -> fetcharray( $result ) )
    {
        $cat_form -> addItem( $cat_row['cid'], $cat_row['title'], $cat_row['pid'] );
    } 
    echo $cat_form -> render();
} 
else
{
    echo "<div><b>" . _AM_WFL_PERM_CNOCATEGORY . "</b></div>";
} 
unset ( $cat_form );

/*
* 
*/ 
echo "<h4>" . _AM_WFL_PERM_RATEPERMISSIONS . "</h4>\n";
$cat_form = new XoopsGroupPermForm( '', $xoopsModule -> getVar( 'mid' ), 'WFLinkRatePerms', _AM_WFL_PERM_RATEPERMISSIONS_TEXT."<br />" );
$result = $xoopsDB -> query( "SELECT cid, pid, title FROM " . $xoopsDB -> prefix( WFLINKS_CAT ) );
if ( $xoopsDB -> getRowsNum( $result ) )
{
    while ( $cat_row = $xoopsDB -> fetcharray( $result ) )
    {
        $cat_form -> addItem( $cat_row['cid'], $cat_row['title'], $cat_row['pid'] );
    } 
    echo $cat_form -> render();
} 
else
{
    echo "<div><b>" . _AM_WFL_PERM_CNOCATEGORY . "</b></div>";
} 
unset ( $cat_form );


echo _AM_WFL_PERM_PERMSNOTE;
echo "<br />";
xoops_cp_footer();

?>